package 笔试.A2022美团;

import java.util.Scanner;

public class second {
    public static void main(String arg[]){//main--来自高金磊

         Scanner scanner=new Scanner(System.in);
         int n=scanner.nextInt();
        for (int i = 0; i < n; i++) {
            long data= scanner.nextLong();
            if (data%11==0||plus(data)){
                System.out.println(true);
            }else {
                System.out.println(false);
            }
        }
    }

    private static boolean plus(long data) {
        int count=0;
        while (data!=0){
            if (data%10==1){
                count++;
                if (count>=2)
                    return true;
            }
            data/=10;
        }
        return false;
    }
}
